﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using PeekService;

namespace PeekWebApp.handler
{
    /// <summary>
    /// checkEmail 的摘要说明
    /// </summary>
    public class checkEmail : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string email=context.Request["email"];
            UserRegistry reg = new UserRegistryService().GetAll().Find(o => o.Email.Equals(email) && o.IsEmailVerification);
            if (reg != null)
            {
                context.Response.Write("false");
            }
            else
            {
                context.Response.Write("true");
            }
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}